#pragma once
#define WINDOW_WIDTH 960
#define WINDOW_HEIGHT 720
#define MAINMENU_BUTTON_WIDTH 500
#define MAINMENU_BUTTON_HEIGHT 50
#define TURN_CHANGE_BUTTON_WIDTH 150
#define TURN_CHANGE_BUTTON_HEIGHT 50
#define BACK_BUTTON_WIDTH 50
#define BACK_BUTTON_HEIGHT 50
#define BACK_BUTTON_X 50
#define BACK_BUTTON_Y 50
#define ABOUT_TEXT_X 100
#define ABOUT_TEXT_Y 100
#define ABOUT_TEXT_GAP 10
#define NET_BG_WIDTH 640
#define NET_BG_HEIGHT 480
#define NET_POINTER_WIDTH 50
#define NET_POINTER_HEIGHT 50
#define IP_SELECTOR_X ((WINDOW_WIDTH-NET_BG_WIDTH)/2+NET_POINTER_WIDTH*2)
#define IP_SELECTOR_Y ((WINDOW_HEIGHT-NET_BG_HEIGHT)/2+NET_POINTER_HEIGHT)
#define IP_SELECTOR_WIDTH ((WINDOW_WIDTH+NET_BG_WIDTH)/2-IP_SELECTOR_X)
#define IP_SELECTOR_HEIGHT ((WINDOW_HEIGHT+NET_BG_HEIGHT)/2-IP_SELECTOR_Y)
#define HOST_IP_Y 40
#define NET_INFO_X 20
#define NET_INFO_Y 650
#define NET_BUTTON_Y 620
#define TURN_CHANGE_GAP 20
#define MAINMENU_GAP 60
#define HANDCARD_X 300
#define HANDCARD_Y 600
#define ENEMY_HANDCARD_Y -50
#define HANDGAP 105
#define COST_X 50
#define COST_Y 520
#define HP_X 50
#define HP_Y 570
#define DECK_X 720
#define DECK_Y 450
#define GY_X 720
#define GY_Y 500
#define ENEMY_COST_X 50
#define ENEMY_COST_Y 10
#define ENEMY_HP_X 50
#define ENEMY_HP_Y 60
#define ENEMY_DECK_X 720
#define ENEMY_DECK_Y 100
#define ENEMY_GY_X 720
#define ENEMY_GY_Y 150
#define DIRECT_HEIGHT 20
#define RESULT_Y 200
#define SHOWN_CARD_Y 130
#define SURRENDER_X 50
#define SURRENDER_Y 630
#define TURNCHANGE_WIDTH 600
#define TURNCHANGE_HEIGHT 100

#define MAP_CORRECTION 30

//game data define
#define INIT_HP 20
#define INIT_COST 1
#define INIT_COST_INCREASE 1
#define MAX_COST 10
#define HANDCARD_LIMIT 6
#define INIT_HANDCARD_NUM 4
#define DECK_NUM 20

//map
#define MAP_WIDTH 350
#define MAP_HEIGHT 450
#define MAP_SIDE 2
#define BLOCK_WIDTH 50
#define BLOCK_HEIGHT 50
#define MAP_X ((WINDOW_WIDTH-MAP_WIDTH)/2)
#define MAP_Y ((WINDOW_HEIGHT-MAP_HEIGHT)/2-MAP_CORRECTION)

//card mapping
#define CARD_WIDTH 252
#define CARD_HEIGHT 352
#define CARD_WIDTH_SMALL 95
#define CARD_HEIGHT_SMALL 132
#define CARD_TITLE_X 2
#define CARD_TITLE_Y 2
#define CARD_TITLE_WIDTH 195
#define CARD_TITLE_HEIGHT 50
#define CARD_COST_X 200
#define CARD_COST_Y 2
#define CARD_COST_WIDTH 50
#define CARD_COST_HEIGHT 50
#define CARD_PIC_X 2
#define CARD_PIC_Y 55
#define CARD_PIC_WIDTH 195
#define CARD_PIC_HEIGHT 193
#define CARD_DESC_X 2
#define CARD_DESC_Y 250
#define CARD_DESC_WIDTH 248
#define CARD_DESC_HEIGHT 100
#define CARD_ATTRIBUTE_X 200
#define CARD_ATTRIBUTE_Y 55
#define CARD_ATTRIBUTE_WIDTH 50
#define CARD_ATTRIBUTE_HEIGHT 193
#define CARD_GAP 10

//card select
#define SELECT_GAP 10
#define SELECT_WIDTH (4*CARD_WIDTH_SMALL + 3*SELECT_GAP)
#define SELECT_HEIGHT (2*CARD_HEIGHT_SMALL + SELECT_GAP)
#define SELECT_X ((WINDOW_WIDTH-SELECT_WIDTH)/2)
#define SELECT_Y ((WINDOW_HEIGHT-SELECT_HEIGHT)/2)
#define SELECT_TITLE_WIDTH 150
#define SELECT_TITLE_HEIGHT 30
#define SELECT_TITLE_X ((WINDOW_WIDTH+SELECT_X+SELECT_WIDTH-SELECT_TITLE_WIDTH)/2)
#define SELECT_TITLE_Y ((WINDOW_HEIGHT-DECK_NUM*SELECT_TITLE_HEIGHT)/2-50)

#define FPS 60

#define FADEFRAME 20
#define GAMEOVERFRAME 15
#define TARGET_TRANSPARENCY 200
#define TURNCHANGEFRAME 20

//state define
#define MAINMENU 0
#define GAMEPLAYING 1
#define GAMEOVER 2
#define NETPROCESS 3
#define DECKEDIT 4
#define ABOUT 5
#define CARDSELECT 0
#define MOVINGSELECT 1
#define ENEMYSELECT 2

//card type enum
#define UNIT_CARD 1
#define ACTION_CARD 2

//source url
#define FONT_URL "./src/font/OPPOSans-B.ttf"
#define DECK_PATH "./deck/"

#define MAIN_TITLE_FONT_SIZE 150
#define BUTTON_STRING_SIZE 20
#define COST_FONT_SIZE 40
#define DESC_FONT_SIZE 15
#define TITLE_FONT_SIZE 35
#define ATTRIBUTE_FONT_SIZE 20
#define GUI_COST_FONT_SIZE 50
#define RESULT_FONT_SIZE 100
